<template>
  <div>
    <!-- 应该放在这里 -->
		<nav-tpl></nav-tpl>
    <router-view></router-view>
  </div>
</template>
<script>
import axios from '../util/axios'
import navTpl from '../views/Navs.vue'
export default {
  components: {
		navTpl,
	},
	data () {
		return {

		}
	},
  created () {
		//获取用户权限
		axios.get('getPermissions').then(res=>{
			this.$store.dispatch('setPermissions', { 
				permissions: res.data.map(res=>{ 
					return res.Title
				}) 
			}); //保存权限到全局

			this.$store.dispatch('setOthers', { 
				others: {
					AlreadyLaunched: res.AlreadyLaunched,
					Audited: res.Audited,
					GeneralLedger: res.GeneralLedger,
					WaitForAudit: res.WaitForAudit
				}
			}); //保存其他数据到全局
		}).catch(err=>{
			console.log(err);        
		})
	}
}
</script>
